package com.beirtipol.travel;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import com.beirtipol.travel.activities.StatusActivity;

public class MainActivity extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
	MenuInflater inflater = getMenuInflater();
	inflater.inflate(R.menu.mainmenu, menu);
	return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    {
	// Handle item selection
	switch (item.getItemId())
	{
	    case R.id.mainmenu_status:
		showStatusActivity();
	    default:
		return super.onOptionsItemSelected(item);
	}

    }

    private void showStatusActivity()
    {
	Intent myIntent = new Intent(getCurrentFocus().getContext(), StatusActivity.class);
	startActivityForResult(myIntent, 0);
    }
}